import http from '@/utils/http'


/**
 * 获取预付订单列表
 */
export const getMemberOrderPre = () => {
    return http({ 
        url:'/member/order/pre'
     });
  };

  export const getMemberOrderPreNow = (data) => {
    return http({ 
        url:'/member/order/pre/now',
        data
     });
  };


  /**
   * 
   * @param {object} data data 创建订单用到的数据
   * @returns 
   */

  export const postMemberOrder = (data) =>{
    return http({
        url:'/member/order',
        method:'post',
        data
    })
  }


  export const getMembeOrderById = (id) =>{
    return http({
        url:`/member/order/${id}`
    })
  }


  /**
   * 
   * @param {string} orderId    订单Id
   * 
   */
  export const getPayMock = (orderId) =>{
    return http({
        url:'/pay/mock',
        data:{orderId}
    })
  }


  /**
   * 获取订单列表
   * @param {object} data   page-页码 pageSize-页容量 orderState - 订单状态，0全部订单 1为待付款、2为待发货、3为待收货、4为待评价、5为已完成、6为已取消
   * @returns 
   */
  export const getMemberOrder= (data) =>{
    return http({
        url:'/member/order',
        data
    })
  }